﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Forging2
{
    
    public class AppConfig
    {
        public List<string> exclude { get; set; } = new List<string>();
        public string OPCServerPath { get; set; }
        public string BackgroupServer { get; set; }
        public string ForgingOPCServerPath { get; set; }
        public List<string> HeatingPLCAddress { set; get; } = new List<string>();
        public List<string> ForgingPLCAddress { set; get; } = new List<string>();
        public string InFurnaceQuery { get; set; }
        public string OutFurnaceQuery { get; set; }
        public string ForgingEquipmentID { get; set; }
        public int ForgingSetSpan { get; set; }
        public string WorkCenter { get; set; }
        public List<string> WorkCells { get; set; } = new List<string>();
        public string OperateCode { get; set; }
        public List<string> FurnaceWorkCells { get; set; }
        public List<string> ForgingWorkCells { get; set; }
        public string RollingWorkCell { get; set; }
        public string  LEDFile { get; set; }

        /*
         public List<PLCInfo> PLCInfos { get; set; }
       public class PLCInfo
       {
           public List<string> NodeID=new List<string>();
           public List<string> NodeName = new List<string>();
       }
        public AppConfig()
        {
            
            for (int i = 0; i < 5; i++)
            {
                PLCAddress.Add(string.Format("Addr{0}", i));
            }

        }

       public List<JRLEquipment> JRL { get; set; } 
       public struct JRLEquipment
       {
           public string EquipmentName { get; set; }
           public List<PLCInfo> PLCInfos { get; set; } 
       }

       public struct PLCInfo
       {
           public string NodeID;
           public string NodeName;
       }

       public class HeatingPLCValue
       {
           public string EquipmentName { get; set; }
           public string NodeID { get; set; }
           public string  NodeName { get; set; }
       }

       public AppConfig()
       {
           JRL = new List<JRLEquipment>();
           var infos = new List<PLCInfo>();
           for (int i = 0; i < 5; i++)
           {
               var jrl = new JRLEquipment();
               jrl.EquipmentName = "JRL" + i.ToString();
               for (int j = 0; j < 5; j++)
               {
                   var info = new PLCInfo();
                   info.NodeID = string.Format("{0}{1}", i, j);
                   info.NodeName = string.Format("NodeName{0}{1}", i, j);
                   infos.Add(info);
               }
               jrl.PLCInfos = infos;
               JRL.Add(jrl);
           }

       }
       */
    }
}
